<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<div>
			<input type="radio" name="so" value="百度" onclick="goBaidu()" />百度
			<input type="radio" name="so" value="谷歌" onclick="goGoogle()" />谷歌
			<input type="radio" name="so" value="淘宝" onclick="goTaobao()" />淘宝
		</div>
		<div>
			<form target="_blank" action="https://www.baidu.com/s" method="GET" id="fo1">
				<img src="../img/baidu_web.png" id="tu">
				<input type="text" name="wd" required />
				<button type="submit">搜索</button>
			</form>
		</div>
		<script>
			function goBaidu() {
				let p = document.getElementById("tu");
				p.src = "../img/baidu_web.png";

				document.querySelector("#fo1").action = "https://www.baidu.com/s";
			}

			function goTaobao() {
				let p = document.getElementById("tu");
				p.src = "../img/taobao_shopping.png";

				document.querySelector("#fo1").action = "https://www.taobao.com/s";
			}

			function goGoogle() {
				let p = document.getElementById("tu");
				p.src = "../img/google_web.png";

				document.querySelector("#fo1").action = "https://www.google.com.hk/s";
			}
		</script>
	</body>
</html>
